<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul {
      width: 550px;
      margin: 0 auto;
      display: flex;
      flex-wrap: wrap;
    }

    li {
      list-style: none;
      width: 100px;
      height: 100px;
      margin: 0 10px 10px 0;
    }

    li img {
      border: 2px solid blue;
      border-radius: 20px 0 20px 0;
    }
  </style>
</head>

<body>

  <script>

    let num = +prompt('请选择英雄个数1-20')
    document.write(` <ul>`)
    for (let i = 1; i <= num; i++) {
      if (num > 20) {
        alert('英雄不够，请充钱')
        break
      }
      document.write(`
     <li><img src="./images/${i}.webp"></li>
    `)
    }
    document.write(`</ul>`)

  </script>


</body>

</html>